home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-12-20 | 1.1 KB | 52 lines | [TEXT/CWIE] |
- ///////////////////////////////////////////////////////////////////////////////
- //
- // This file is a BDIAMOND addition.
- //
-
- #include "ocheaders.h"
- #include "FnAssert.h"
- #include "CError.h"
-
- ///////////////////////////////////////////////////////////////////////////////
- //
- // ASSERT
- //
-
- #ifdef _DEBUG
- void ASSERT(Boolean expression, char * lpstrMsg)
- {
- FnAssert((char *)expression, lpstrMsg, NULL, NULL);
- }
- #endif // _DEBUG
-
- ///////////////////////////////////////////////////////////////////////////////
- //
- // FnAssert
- //
-
- #ifdef _DEBUG
- STDAPI FnAssert(char * lpstrExpr, char * lpstrMsg, char * lpstrFileName, unsigned short iLine)
- {
-
- #pragma unused ( lpstrFileName, iLine )
-
- HRESULT returnValue = ResultFromScode(S_OK);
-
- if ( lpstrExpr == NULL )
- {
- SysBeep(5); // awaken the developer
-
- c2pstr((char *)lpstrMsg);
- DebugStr((StringPtr)lpstrMsg);
- p2cstr((StringPtr)lpstrMsg);
-
- throw CError(FAILED_ASSERTION_ERROR); // CError just tosses it again, so we should terminate
- // no return
- }
- else
- returnValue = ResultFromScode(S_OK);
-
- return returnValue;
- }
- #endif // _DEBUG
-